<template>
  <div class="box_notic">
    <swiper v-if='showSwiper' :options="swiperOption">
      <swiper-slide v-for="items of imgs" :key="items.id">
        <img class='swiper-img' :src="items.imgUrl" />
      </swiper-slide>
    </swiper>
  </div>
</template>

<script>
export default {
  name: 'ArticalNotice',
  data () {
    return {
      imgs: [
        {
          id: '1',
          imgUrl: require('../../../assets/images/arti1.jpg')
        },
        {
          id: '2',
          imgUrl: require('../../../assets/images/arti3.jpg')
        },
        {
          id: '3',
          imgUrl: require('../../../assets/images/arti2.jpg')
        }
      ],
      swiperOption: {
        pagination: '.swiper-pagination',
        paginationClickable: true,
        autoplayDisableOnInteraction: false,
        grabCursor: true,
        loop: true,
        autoplay: 4000
      }
    }
  },
  computed: {
    showSwiper () {
      return this.imgs.length
    }
  }
}
</script>

<style lang="stylus" scoped>
  .box_notic{
    position: relative
    float: right
    right: 0
    top: 1.7rem
    z-index: 0
    width: 350px
    height: 930px
    overflow: hidden
    margin-top: .1rem
    .swiper-img{
      background-color: #fff
      width: 100%
      img{
        height: 100%
        width: 100%
      }
    }
  }
</style>
